<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html>
<head>
    <title>新闻发布</title>
    <link rel="stylesheet" href="${ctx}/static/styles/news/wangEditor.min.css" type="text/css">
    <link rel="stylesheet" href="${ctx}/static/styles/common.css" type="text/css">
    <link rel="stylesheet" href="${ctx}/static/styles/news/news.css" type="text/css">

</head>

<body>
<div class="news-post">
    <div class="container">
        <h2>新闻发布</h2>
        <form id="inputForm" role="form" action="${ctx}/news/${action}" method="post" class="form-horizontal">
            <input type="hidden" name="id" value="${news.id}"/>
            <input type="hidden" name="publishDate" value="${news.publishDate}"/>
            <div class="form-group">
                <span class="news-label">信息标题</span>
                <div class="col-sm-8">
                    <input type="text" class="form-control" name="title" value="${news.title}" placeholder="输入标题">
                </div>
                <div class="col-md-2 errortip"></div>
            </div>
            <div class="form-group">
                <span class="news-label">关&nbsp;键&nbsp;词</span>
                <div class="col-sm-8">
                    <input type="text" class="form-control" name="keywords" value="${news.keywords}"
                           placeholder="输入关键词">
                </div>
                <div class="col-md-2 errortip"></div>
            </div>
            <div class="form-group">
                <span class="news-label">信息来源</span>
                <div class="col-sm-8">
                    <input type="text" class="form-control" name="source" value="${news.source}"
                           placeholder="输入关键词">
                </div>
                <div class="col-md-2 errortip"></div>
            </div>
            <div class="form-group">
                <label class="news-label">信息正文</label>
                <textarea class="form-control" rows="15" id="editArea" name="content"> ${news.content}</textarea>
            </div>
            <div class="news-btn-area">
                <button type="submit" class="btn btn-success info-submit">
                    <span class="glyphicon glyphicon-ok"></span> 发布
                </button>
                <button type="reset" class="btn btn-danger">
                    <span class="glyphicon glyphicon-remove"></span> 重置
                </button>
            </div>
        </form>
    </div>
</div>

<script src="${ctx}/static/js/jquery-2.1.1.min.js" type="text/javascript"></script>
<script src="${ctx}/static/plugins/wangeditor/wangEditor.min.js" type="text/javascript"></script>
<script src="${ctx}/static/plugins/wangeditor/editor.config.js" type="text/javascript"></script>

<script>
    $(document).ready(function () {
        //聚焦第一个输入框
        $("#news-label").focus();
    });
</script>
</body>
</html>
